package com.xuchaotong.feign.controller;

import com.xuchaotong.feign.service.UserService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 311633
 * @version 1.0
 * @ClassName:
 * @Description:
 * @date 2017/11/3 18:25
 */
@RestController
public class HiController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    public String sayHi(@RequestParam String name) {
        return userService.sayHi(name) + ", this's feign";
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
